import $ from '../common';
Page({
  data: {
    isIphoneX: $.gData().isIphoneX,
    istip:false,
    noimg:$.noImage
  },
  onLoad(e) {
    this.setData({
      group_uuid:e.group_uuid,
      student_uuid:e.student_uuid,
      zonecode:wx.getStorageSync('addresscode')||''
    })
    this.getinfo()
  },
  onShow() {

  },
  onReachBottom() {

  },
  getinfo(){
    $.get('/campus/group/detail',{
      zonecode:this.data.zonecode,
      group_uuid:this.data.group_uuid,
      student_uuid:this.data.student_uuid
    },res=>{
      this.setData({
        info:res
      })
    })
  },
  goclassinfo(){
    const{info}=this.data
    $.post('/campus/group/apply',{
      material_selected: 'NO',
      group_uuid:info.group.uuid,
      student_uuid:info.student.student_uuid
    },res=>{

    },fail=>{
      this.setData({
        istip:true,
        ner:fail.message
      })
      setTimeout(() => {
        this.setData({
          istip:false,
        })
      }, 2000);
    })
  }
})